﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="~/_controltemplates/InputFormSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" src="~/_controltemplates/InputFormControl.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" src="~/_controltemplates/ButtonSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ToolBar" src="~/_controltemplates/ToolBar.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="~/_controltemplates/ToolBarButton.ascx" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" Inherits="zevenseas.ClassicTheme.CustomThemes" MasterPageFile="/_admin/admin.master" %>

<asp:content ID="Content6" contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">
<script type="text/javascript">
    function Visascii(ch) {
        return (!(ch.charCodeAt(0) & 0x80));
    }
    function Visspace(ch) {
        return (ch.charCodeAt(0) == 32) || ((9 <= ch.charCodeAt(0)) && (ch.charCodeAt(0) <= 13));
    }
    function stripWS(str) {
        var b = 0;
        var e = str.length;
        while (str.charAt(b) && (Visascii(str.charAt(b)) && Visspace(str.charAt(b))))
            b++;
        while ((b < e) && (Visascii(str.charAt(e - 1)) && Visspace(str.charAt(e - 1))))
            e--;
        return ((b >= e) ? "" : str.substring(b, e));
    }
    var L_NoFieldEmpty_TEXT = "<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,common_nofieldempty_TEXT%>' EncodeMethod='EcmaScriptStringLiteralEncode'/>";
    function CheckForEmptyField(text_orig, field_name) {
        var text = stripWS(text_orig);
        if (text.length == 0) {
            alert(StBuildParam(L_NoFieldEmpty_TEXT, field_name));
            return false;
        }
        return (true);
    }
    function CheckForEmptyFieldNoAlert(text_orig) {
        var text = stripWS(text_orig);
        if (text.length == 0) {
            return false;
        }
        return (true);
    }
    var L_WrongEmailName_TEXT = "<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,common_wrongemailname_TEXT%>' EncodeMethod='EcmaScriptStringLiteralEncode'/>";
    function CheckForAtSighInEmailName(text_orig, field_name) {
        var text = stripWS(text_orig);
        if (!CheckForEmptyField(text_orig, field_name)) return false;
        var indexAt = 0;
        var countAt = 0;
        var countSpace = 0;
        var len = text.length;
        while (len--) {
            if (text.charAt(len) == '@') {
                indexAt = len;
                countAt++;
            }
            if (text.charAt(len) == ' ')
                countSpace++;
        }
        if ((countAt == 0) ||
		(indexAt == 0) ||
		(indexAt == (text.length - 1))
		) {
            alert(StBuildParam(L_WrongEmailName_TEXT, field_name));
            return false;
        }
        if (countSpace != 0) {
            alert(L_TextWithoutSpaces1_TEXT + field_name);
            return false;
        }
        return (true);
    }
    var checkBoxGroupName = "siteCheckboxes";
    function checkBoxClick() {
        var checkBoxHidden = (document.getElementById("<%= HiddenSiteSelections.ClientID %>"));
        checkBoxHidden.value = "";
        var selectAllCheckBox = document.getElementById("selectAllCheckBox");
        if (selectAllCheckBox != null)
            selectAllCheckBox.checked = false;
        var i;
        for (i = 0; i < theForm.length; i++) {
            curGroup = theForm[i].group;
            if (checkBoxGroupName == curGroup && theForm[i].checked == true)
                checkBoxHidden.value += theForm[i].name + "#";
        }
    }
    function selectAllCheckBoxClick(selectAllCheckBox) {
        var newCheckBoxState = selectAllCheckBox.checked;
        for (i = 0; i < theForm.length; i++) {
            curGroup = theForm[i].group;
            if (checkBoxGroupName == curGroup)
                theForm[i].checked = newCheckBoxState;
        }
        checkBoxClick();
        selectAllCheckBox.checked = newCheckBoxState;
    }
    function _spBodyOnLoad() {
        var checkBoxHidden = (document.getElementById("<%= HiddenSiteSelections.ClientID %>"));
        checkBoxHidden.value = "";
    }
</script>
</asp:content>
<asp:Content ID="Content7" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<input type="hidden" id="HiddenSiteSelections" runat="server" />
<style type="text/css">
    table.ms-propertysheet {
      height: 100%;
    }
  </style>
  <table cellspacing="0" cellpadding="0" border="0" class="ms-settingsframe">    
    <tr>
      <td valign="top" style="padding: 4px 0px 4px 0px;" height="100%">
  	    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ms-propertysheet">
            <wssuc:InputFormSection Title="Select the WebApplication on which you install the Theme"
                Description="" runat="server">		
                <template_inputformcontrols>              
                    <wssuc:InputFormControl LabelText="" runat="server">
                        <Template_Control>
                            <SharePoint:WebApplicationSelector id="webApplicationSelector" runat="server"/>
                        </Template_Control>
                    </wssuc:InputFormControl>                                    
	            </template_inputformcontrols>            
            </wssuc:InputFormSection>
            
            <wssuc:InputFormSection Title="Add path to custom theme xml definition"
                Description="" runat="server">		
                <template_inputformcontrols>              
                    <wssuc:InputFormControl LabelText="Path (e.g. TEMPLATE\FEATURES\CUSTOMTHEME\CUSTOMTHEME.XML) " runat="server">
                        <Template_Control>
                            <SharePoint:InputFormTextBox id="uxTheme" runat="server" RichText="false" Width="100%"/>
                        </Template_Control>
                    </wssuc:InputFormControl>                                    
	            </template_inputformcontrols>            
            </wssuc:InputFormSection>
            
	   <wssuc:InputFormSection Title="Added Xml path's"
                Description="" runat="server">		
                <template_inputformcontrols>                                  
                    <wssuc:InputFormControl LabelText="" runat="server">
                        <Template_Control>
                            <wssuc:ToolBar id="ToolBar" runat="server">
                                <template_buttons>                              
                                    <wssuc:ToolBarButton runat="server"
				                        id="Delete"
				                        Text="Delete paths"
				                        ToolTip=""
				                        OnClick="DeleteLink"
				                        ImageUrl="/_layouts/images/newitem.gif"
				                        Padding="2px"
				                        AccessKey="D" />
				 </template_buttons>
                            </wssuc:ToolBar>
                            <SharePoint:SPGridView runat="server" ID="gridView" 
                                AutoGenerateColumns="false">
                                <AlternatingRowStyle CssClass="ms-alternating" />
	                                <Columns>
		                                <asp:BoundField DataField="FilePaths" DataFormatString='<input type="checkbox" group="siteCheckboxes" name="{0}" onclick="checkBoxClick();">' HtmlEncode="false" HeaderText="" ItemStyle-Width="1"/>			    
			                            <SharePoint:SPBoundField DataField="FilePaths"  HeaderText="FilePaths" HeaderStyle-Font-Bold="true" />
		                            </Columns>
                            </SharePoint:SPGridView>
                        </Template_Control>
                    </wssuc:InputFormControl>                               
	            </template_inputformcontrols>            
            </wssuc:InputFormSection>                     
            
            <wssuc:ButtonSection runat="server">
                <Template_Buttons>
                    <asp:Button runat="server" class="ms-ButtonHeightWidth" OnClick="OnClickOK" Text="<%$Resources:wss,multipages_okbutton_text%>" id="btnOk" accesskey="<%$Resources:wss,okbutton_accesskey%>"/>
                </Template_Buttons>
            </wssuc:ButtonSection>                 
          </table>
        </td>
    </tr>
  </table>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
Application Page
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
My Application Page
</asp:Content>
